import request from '@/utils/request'
// 获取列表
export function getDataList(params) {
  return request({
    url: '/quality/qualityFileItem/selectCheckLedger',
    method: 'get',
    params,
  })
}
// 获取延期申请列表
export function getPostpone(params) {
  return request({
    url: '/quality/qualityFileItem/selectExtensionLedger',
    method: 'get',
    params,
  })
}
//分包单位
export function getSubUnits() {
  return request({
    url: 'common/cooperator/enterpriseTypeList',
    method: 'get',
  })
}
//移交下拉
export function handOverList(query) {
  return request({
    url: '/common/project/transferUser',
    method: 'get',
    params: query
  })
}
export function doRevise(data) {
  return request({
    url: '/quality/qualityFileItem/addRectifyReview',
    method: 'post',
    data,
  })
}
export function doReview(data) {
  return request({
    url: '/quality/qualityFileItem/addRectifyCheck',
    method: 'post',
    data,
  })
}
export function doOver(data) {
  return request({
    url: '/common/project/transfer',
    method: 'post',
    data
  })
}
export function doDelay(data) {
  return request({
    url: '/review/review/apply',
    method: 'put',
    data
  })
}
// 点击复查时，获取当前记录的流程信息
export function getSelectReviewCheck(id) {
  return request({
    url: '/quality/qualityFileItem/selectChildReview?recordId=' + id,
    method: 'get',
  })
}
// 查询整改记录
export function getReviseDetail(params) {
  return request({
    url: '/quality/qualityFileItem/selectChildReview',
    method: 'get',
    params,
  })
}
// 查询复查记录
export function getReviewDetail(params) {
  return request({
    url: '/quality/qualityFileItem/selectChildReview2',
    method: 'get',
    params,
  })
}

export function getDelayDetail(id) {
  return request({
    url: '/extension/requests/' + id,
    method: 'get',
  })
}

//延期申请审批提交
export function doPostpone(data) {
  return request({
    url: '/quality/qualityFileItem/accept',
    method: 'put',
    data
  })
}
//项目自检待办
export function getSelfTest(data) {
  return request({
    url: '/api/project/check/relatedList',
    method: 'post',
    data
  })
}

export function addSelfTest(data) {
  return request({
    url: '/api/project/check/splitFile',
    method: 'post',
    data
  })
}

//公司检查待办
export function getExamine(data) {
  return request({
    url: '/quality/qualityEnterCheckProject/myTodo',
    method: 'get',
    params:data
  })
}

//结束项目自检
export function endTask(data) {
  return request({
    url: '/api/project/check/updateProjectStatus',
    method: 'post',
    data
  })
}

//完成公司检查
export function finishTask(data) {
  return request({
    url: '/quality/qualityEnterCheckProject/updateProjectStatus',
    method: 'post',
    data
  })
}

//计划任务待办
export function getTasksToDo(data) {
  return request({
    url: '/quality/qualityPlanTaskProject/list',
    method: 'get',
    params:data
  })
}

export function splitData(data) {
  return request({
    url: '/quality/qualityEnterCheckProject/splitFile',
    method: 'post',
    data,
  })
}
export function getQuestionList() {
  return request({
    url: '/quality/questions/questionList',
    method: 'get'
  })
}

export function getQualityProblemList(data) {
  return request({
    url: '/api/project/check/getQualityProblemList',
    method: 'post',
    data,
  })
}
